package reflect;

import java.lang.reflect.Field;

public class Modifier {
    public static void main(String[] args) throws Exception{
        String s1="abc";
        String s2="abc";
        System.out.println(s1);
        System.out.println(s2);

        //Class cls=String.class;
        Class cls=Class.forName("java.lang.String");

        Field field = cls.getDeclaredField("value");
        field.setAccessible(true);
        field.set(s1,new char[]{'d','e','f'});
        field.setAccessible(false);
        System.out.println(s1);

        String s3="abc";
        System.out.println(s3);


    }
}
